<?php
declare (strict_types=1);

use think\facade\Route;

//前缀
$controller = '\app\scan_bag\controller\V1_Way_1_0';
/**
 * 微信扫码取袋(不需要登录)
 */
Route::group(function () use ($controller) {
    //公众号开始
    Route::post('wechatLogin$', $controller . '@wsWechatLogin')->name('微信H5用户登录');
    Route::any('wechatGetJsApiConfig$', $controller . '@jsApiConfig')->name('获取JSAPI配置');
    Route::post('verifyCapture$', $controller . '@verifyCapture')->name('腾讯云验证码验证票据');
    Route::post('showCapture', $controller . '@showCapture')->name('小程序是否要显示验证码');
    //微信小程序
    Route::post('miniProgramLogin$', $controller . '@miniProgramLogin')->name('微信小程序用户登录');


})->middleware(middleware\NoAuthMiddleware::class, 'scan_bag');

/**
 * 微信扫码取袋(需要登录)
 */
Route::group(function () use ($controller) {
    //公众号开始
    Route::get('getMacIdWay$', $controller . '@getMacIdWay')->name('通过设备mac_id获取取袋路径');
    Route::get('wechatUserScanNum$', $controller . '@userScanNum')->name('微信H5用户取袋次数');
    Route::get('wechatQrcode$', $controller . '@wechatQrcode')->name('微信H5公众号二维码');
    Route::post('wechatURLScheme$', $controller . '@getURLScheme')->name('微信小程序URLScheme');
    Route::get('wechatGetSafeCode$', $controller . '@getSafeCode')->name('获取安全code');
    Route::post('wechatPayOrder$', $controller . '@payOrder')->name('微信取袋发起支付');
    //微信小程序
    Route::get('wechatUserInfo$', $controller . '@getUserInfo')->name('微信获取用户信息');
    Route::post('wechatLatLon$', $controller . '@wechatLatLon')->name('微信上传经纬度信息');
    Route::get('wechatAppletAdvert$', $controller . '@wechatAppletAdvert')->name('微信小程序广告ID');
    Route::post('wechatOutBag$', $controller . '@postOutBag')->name('微信出袋接口');
    Route::post('wechatOutBag5s$', $controller . '@postOutBag5s')->name('微信出袋接口(延迟5S)');
    //广告小程序
    Route::get('wechatPopularizeProgram$', $controller . '@wechatPopularizeProgram')->name('微信小程序获取推广小程序');
    Route::post('wechatPopularizeWrite$', $controller . '@wechatPopularizeWrite')->name('微信小程序写入推广统计');
    Route::get('locationLimit$', $controller . '@locationLimit')->name('判断是否打开位置限制');

})->middleware(middleware\AuthMiddleware::class, 'scan_bag');



